import { http } from "@/utils/http";

export type LineChartVo = {
  value: number;
  percent: string;
  lineData: Array<number>;
};

export type GroupCountVo = {
  column: string;
  count: number;
};

export type BarChartVo = {
  column: Array<string>;
  data: Array<BarChartDataVo>;
};

export type BarChartDataVo = {
  name: string;
  data: Array<number>;
};

export const employee = () => {
  return http.request<LineChartVo>("get", "/analyse/employee");
};
export const employment = () => {
  return http.request<LineChartVo>("get", "/analyse/employment");
};
export const resignation = () => {
  return http.request<LineChartVo>("get", "/analyse/resignation");
};
export const gender = () => {
  return http.request<Array<GroupCountVo>>("get", "/analyse/gender");
};
export const education = () => {
  return http.request<Array<GroupCountVo>>("get", "/analyse/education");
};
export const salary = () => {
  return http.request<Array<GroupCountVo>>("get", "/analyse/salary");
};
export const yearEmployee = (year: number) => {
  return http.request<BarChartVo>("get", "/analyse/yearEmployee", {
    year: year
  });
};
